![]() | JavaScript Web & Mobile Deployments | Constraints Inference | ![]() |
The following Properties of the Hierarchy object enable access to the hierarchy data:
baseClass(<index>): This property stores the name of the "Base Class" of the Object given by <index>.
count: Returns the number of selected nodes in the runtime hierarchy.
getPropValue(<index>,<propNo>[,<selectionNo>]): This is the instance property value given by <propNo> of the node given by <index>.
getValue(<index>[,<selectionNo>]): This is the selected instances of the node given by <index>.
hierarchyName(<index>): This is used to identify the Hierarchy Name to which an object belongs, where more than one hierarchy is inferred from. All inferred Hierarchies (nested or not) in a single runtime session are included in the "Hierarchy" Object unless it is explicitly cleared with @Clear Hierarchy command. So the hierarchyName property can be used to identify the Hierarchy to which the node belongs.
indent(<index>): This is the hierarchy indentation level of the object that is used to identify child/parent relationships.
name(<index>): This is the name of the object given by <index>.
nProps(<index>): This is the number of instance properties of the node given by <index>.
nSelected(<index>: This is the number of selected instances of the node given by <index>.
propName(<index>,<propNo>): This is the name of instance property given by <propNo> of the node given by <index>.
Note that only properties designated for 'output in Hierarchy' are included.
The following example shows the accessing of hierarchy data in a Procedure:
@Dim node:N, node_properties:N, node_values:N, tempstr:S
@For node = 1 to Hierarchy.count
@For node_values = 1 to Hierarchy.nSelected(node)
@If node = 1
@Assign tempstr = Hierarchy.name(node) & '=' &
Hierarchy.getValue(node,node_values)
@Else
@Assign tempstr = tempstr & #10 & #13 & Hierarchy.name(node) & '=' &
Hierarchy.getValue(node,node_values)
@Endif
@If Hierarchy.nProps(node) > 0
@For node_properties = 1 to Hierarchy.nProps(node)
@Assign tempstr = tempstr & ', ' &
Hierarchy.propName(node,node_properties,node_values) & '=' &
Hierarchy.getPropValue(node,node_properties,node_values)
@Next
@Endif
@Next
@Debug tempstr
@Next